package dancrawler.server.gamecmd;

import dancrawler.proto.cmd.CmdHandler;
import dancrawler.proto.cmd.CmdHandler;
import dancrawler.server.Server;
import dancrawler.server.netMsg;

/**
 *
 */
public class CmdPing extends CmdHandler {

    private Server server;

    public CmdPing(Server server) {
        this.server = server;
    }

    @Override
    public void handleCmd(netMsg msg) {
        msg.getSender().setLastPing(System.currentTimeMillis());
        netMsg msg2 = new netMsg((short) 12, (short) 0, null);
        msg2.setFinalized(true);
        msg.getSender().getOutQueue().offer(msg2);
    }

    @Override
    public int getNumArgs() {
        return 0;
    }

    @Override
    public int getId() {
        return 11;
    }

    @Override
    public int getArgSize(int n) {
        return 0;
    }

    @Override
    public CmdHandler getHandler() {
        return this;
    }
}
